import config from '@/config'
import request from '@/utils/request'

// 登录
export function loginFun(params: Record<string, any>) {
    return request.post({ url: '/login/account', params: { ...params, terminal: config.terminal } })
}

// 退出登录
export function logout() {
    return request.post({ url: '/login/logout' })
}

// 用户信息
// export function getUserInfo() {
//     return request.get({ url: '/auth.admin/mySelf' })
// }
export function getUserInfo() {
    return request.get({ url: '/user/info' })
}
// 编辑管理员信息
export function setUserInfo(params: any) {
    return request.post({ url: '/auth.admin/editSelf', params })
}
// 注册
export function register(params: any) {
    return request.post({ url: '/login/register', params })
}

// 修改用户信息
export function userUpDate(params: any) {
    return request.post({ url: '/user/update', params })
}

// 获取扫码
export function getScanCode(params: any) {
    return request.get({ url: '/login/getScanCode', params })
}
// 扫码登录
export function scanLogin(params: any) {
    return request.post({ url: '/login/scanLogin', params })
}

// 绑定微信
export function oaAuthBind(params: any) {
    return request.post({ url: '/login/oaAuthBind', params })
}

// 绑定pc端
export function pcAuthBind(params: any) {
    return request.post({ url: '/login/pcAuthBind', params })
}
